<!doctype html>
<html lang="en">
<head>
    @include('web.layout.head')
    <link rel="stylesheet" href="{{asset('/css/web/user/shop_brand.css')}}">
    <link rel="stylesheet" href="{{asset('/css/web/user/contract_msg.css')}}">
</head>
<body>
@include('web.layout.header')
@include('web.layout.user_tab')
<div class="base_member_content">
    <div class="w1200">
        @include('web.layout.seller_nav')
        <div class="nav_right flr">
            <div class="base_content">
                <div class="line_title" style="border-bottom:0;">合同信息</div>
                <div class="content">
                    <form id="postForm" method="get" action="/member/seller/order_contract/contract_write" >
                    <input   value="{{$order_id}}" name="order_id" type="hidden" />
                    <input   value="{{$qid}}" name="qid" type="hidden" />
                        <div class="contract_top">
                            <ul>
                                <li class="first">1、基础信息</li>
                                <li>2、签署合同</li>
                                <li>3、确认成功</li>
                            </ul>
                        </div>
                        <div class="prompt_box">
                            <div class="tit fl">企业名称</div>
                            <div class="input_box fl">
                                <p class="company_name">{{$company['company_name']}}</p>
                            </div>
                        </div>
                        <div class="prompt_box">
                            <div class="tit fl">公司地址</div>
                            <div class="input_box fl">
                                <p class="company_name">{{$company['company_address']}}</p>
                            </div>
                        </div>
                        <div class="prompt_box">
                            <div class="tit fl">联系人姓名</div>
                            <div class="input_box fl">
                                <input type="text" class="fl w498 user-name" name="name" value="" verify="ok">
                            </div>
                        </div>
                        <div class="prompt_box">
                            <div class="tit fl">联系人手机号</div>
                            <div class="input_box fl">
                                <input type="text" class="fl w498 user-phone" name="phone" value="" verify="ok">
                            </div>
                        </div>
                        <div class="prompt_box">
                            <div class="tit fl">申请期限(工作日)</div>
                            <div class="input_box fl">
                                <input type="text" class="fl w498 apply-term" name="term" value="" placeholder="如：12个工作日" verify="ok">
                            </div>
                        </div>
                        <div class="prompt_box">
                            <div class="tit fl">投标保证金</div>
                            <div class="input_box fl">
                                <input type="text" class="fl w498 bid-bond" name="bond" value="" verify="ok">
                            </div>
                        </div>
                        <input type="button" class="btn_submit" value="确认"/>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

@include('web.layout.footer')
<script>
$(function () {
    var name= /^[\u4e00-\u9fa5 ]{2,20}$/;//联系人
    var phone=/^1(3|4|5|7|8)\d{9}$/; //手机号
    var term=/^[A-Za-z0-9\u4e00-\u9fa5]+$/;//申请期限
    var bond=/^[0-9\u4e00-\u9fa5]+$/;//投标保证金
    $(".btn_submit").click(function () {
        var user_name=$('input[name="name"]').val();
        var user_phone=$('input[name="phone"]').val();
        var apply_term = $('input[name="term"]').val();
        var bid_bond = $('input[name="bond"]').val();
        if($('input[name="name"]').val() == '') {
            layer.alert('请填写联系人姓名', {
                title: '温馨提示'
            });
            return false;
        }
        if($('input[name="phone"]').val() == '') {
            layer.alert('请填写联系人手机号', {
                title: '温馨提示'
            });
            return false;
        }
        if($('input[name="term"]').val() == '') {
            layer.alert('请填写申请期限', {
                title: '温馨提示'
            });
            return false;
        }
        if($('input[name="bond"]').val() == '') {
            layer.alert('请填写投标保证金', {
                title: '温馨提示'
            });
            return false;
        }
        //---------------------联系人验证
        if(!user_name.match(name)){
			$(".user-name").css("border","1px solid red")
			layer.alert("联系人格式错误！",{icon: 0});
			return false;
		}else{
			$(".user-name").css("border","1px solid green");
        }
        //---------------------手机号验证
		if(!user_phone.match(phone)){
			$(".user-phone").css("border","1px solid red")
			layer.alert("手机号格式错误！",{icon: 0});
			return false;
		}else{
			$(".user-phone").css("border","1px solid green");
        }
        //---------------------申请期限验证
		if(!apply_term.match(term)){
			$(".apply-term").css("border","1px solid red")
			layer.alert("申请期限格式错误！",{icon: 0});
			return false;
		}else{
			$(".apply-term").css("border","1px solid green");
        }
        //---------------------投标保证金验证
		if(!bid_bond.match(bond)){
			$(".bid-bond").css("border","1px solid red")
			layer.alert("投标保证金格式错误！",{icon: 0});
			return false;
		}else{
			$(".bid-bond").css("border","1px solid green");
        }

        $("#postForm").submit();
    })
})
</script>
</body>
</html>